#define  _CRT_SECURE_NO_WARNINGS 1

//练习1：多个字符从两端移动，向中间汇聚

#include<stdio.h>
#include<string.h>
#include<windows.h>

int main()
{
	char arr1[] = "welcome to world!!!!!";
	char arr2[] = "#####################";

	int left = 0;
    //int right = strlen(arr1) - 1;//求字符串长度，\0之前的字符个数
	int right = sizeof(arr1) / sizeof(arr1[0]) - 2;
	//char str[] = "abc";
	//[a b c \0]
	//sizeof(str)/sizeof(str[0])-->4

	while (left <= right)
	{
        arr2[left] = arr1[left];
        arr2[right] = arr1[right];
        printf("%s\n", arr2);
		Sleep(1000);//windows提供的休眠函数，暂停1秒(1000毫秒)
        system("cls");//清屏
        left++;
        right--;
	}
	printf("%s\n", arr2);

	return 0;
}